package com.huangssssx.loader
{
	import flash.utils.Dictionary;

	public class ResManager
	{
		public function ResManager()
		{
		}
		
		public static const RESOURCE_CONFIG:int = 1001;//配置文件
		public static const RESOURCE_IMAGE:int = 1002;//图像
		
		private static var _instance:ResManager;
		
		private var RESOURCE:Dictionary = new Dictionary();
		
		//instance
		public static function getInstance():ResManager
		{
			if(!_instance)
			{
				_instance = new ResManager();
			}
			
			return _instance;
		}
		
		public function setRes(type:int,key:Object,value:Object):void
		{
			if(!RESOURCE[type])
			{
				RESOURCE[type] = new Dictionary();
			} 
			
			RESOURCE[type][key] = value;
		}
		
		public function getRes(type:int,key:Object):Object
		{
			if(!RESOURCE[type])
			{
				return null;
			}
			
			return RESOURCE[type][key];
		}
		
	}
}